using System;
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
namespace JSG.BubbleShoot
{
    public class EditorBallBase : MonoBehaviour
    {
        public SpriteRenderer m_Image;
        public Sprite[] m_ColorSprites;
        public Sprite m_BombSprite;
        public Sprite m_RockSprite;
        //[HideInInspector]
        public int m_ColorNum = 0;
        public int m_TypeNum = 0;
        // Start is called before the first frame update
        public void SetColor(int num)
        {
            m_ColorSprites = new Sprite[6];
            m_ColorSprites[0] = Resources.Load<Sprite>("ball (1)");
            m_ColorSprites[1] = Resources.Load<Sprite>("ball (2)");
            m_ColorSprites[2] = Resources.Load<Sprite>("ball (3)");
            m_ColorSprites[3] = Resources.Load<Sprite>("ball (4)");
            m_ColorSprites[4] = Resources.Load<Sprite>("ball (5)");
            m_ColorSprites[5] = Resources.Load<Sprite>("ball (6)");
            m_TypeNum = 0;
            m_ColorNum = num;
            m_Image.sprite = m_ColorSprites[num];
        }

        public void SetType(int num)
        {
            if (num == 0)
            {
                m_ColorSprites = new Sprite[6];
                m_ColorSprites[0] = Resources.Load<Sprite>("ball (1)");
                m_ColorSprites[1] = Resources.Load<Sprite>("ball (2)");
                m_ColorSprites[2] = Resources.Load<Sprite>("ball (3)");
                m_ColorSprites[3] = Resources.Load<Sprite>("ball (4)");
                m_ColorSprites[4] = Resources.Load<Sprite>("ball (5)");
                m_ColorSprites[5] = Resources.Load<Sprite>("ball (6)");
                m_TypeNum = 0;
                m_Image.sprite = m_ColorSprites[m_ColorNum];
            }
            else if (num == 1)
            {
                m_BombSprite = Resources.Load<Sprite>("ball-bomb-1");
                m_TypeNum = 1;
                m_Image.sprite = m_BombSprite;
            }
            else if (num == 2)
            {
                m_RockSprite = Resources.Load<Sprite>("ball-rock-1");
                m_TypeNum = 2;
                m_Image.sprite = m_RockSprite;
            }
        }

        void OnDrawGizmosSelected()
        {
            Gizmos.DrawWireSphere(transform.position, 3);
        }
    }
}